#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    time=new QTimer(this);
    connect(time,&QTimer::timeout,[=](){
        static int num=1;
        ui->lcdNumber->display(QString::number(num++));
    });

}

Widget::~Widget()
{
    delete ui;
}

void Widget::on_pushButton_clicked()
{
    time->start(1000);
}

void Widget::on_pushButton_2_clicked()
{
    time->stop();
}
